//
//  WSAddDeviceBluetoothViewController.m
//  FamilyLinkPro
//
//  Created by 江鹏 on 2023/9/13.
//  Copyright © 2023 SiterWell.Co.,Ltd. All rights reserved.
//

#import "WSAddDeviceBluetoothViewController.h"

@interface WSAddDeviceBluetoothViewController ()

@end

@implementation WSAddDeviceBluetoothViewController


+ (WSAddDeviceBluetoothViewController *)showController:(UIViewController *) viewController {
    WSAddDeviceBluetoothViewController *vc = [[WSAddDeviceBluetoothViewController alloc] init];
    
    HBDNavigationController *rootNav = [[HBDNavigationController alloc] initWithRootViewController:vc];
//    [UIApplication sharedApplication].keyWindow.rootViewController = rootNav;
    rootNav.modalPresentationStyle = UIModalPresentationFullScreen;
    [viewController presentViewController:rootNav animated:YES completion:nil];
    return vc;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setupSubviews];
    self.hbd_barHidden = NO;
    self.isHideLeftBarButtonItem = NO;
    [self setupRightItemButton];
}


// MARK: 添加子控件
- (void)setupSubviews {
    
    WSAddDeviceBluetoothView *addDeviceBluetoothView = [[WSAddDeviceBluetoothView alloc] initWithFrame:CGRectZero];
    [self.view addSubview:addDeviceBluetoothView];
    [addDeviceBluetoothView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
    [addDeviceBluetoothView layoutSubviewsWithAddDeviceDisplyType:AddDeviceDisplySearchType];
}

- (void)setupRightItemButton {
    UIButton *addDeviceBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [addDeviceBtn setFrame:CGRectMake(0, 0, 40, 40)];
    [addDeviceBtn setImage:ImageNamed(@"icon_scan") forState:UIControlStateNormal];
    [addDeviceBtn addTarget:self action:@selector(scanButtonClick) forControlEvents:UIControlEventTouchUpInside];
    if (_ios11_0_){
        [addDeviceBtn setFrame:CGRectMake(0, 0, 40, 40)];
        // rightBtn.contentEdgeInsets=UIEdgeInsetsMake(0, 0, 0, 10);
    }
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:addDeviceBtn];
    self.navigationItem.rightBarButtonItem = rightItem;
    
}

// MARK: action

- (void)scanButtonClick {
    
}



@end
